package com.example.android.utils.api;

import androidx.lifecycle.LiveData;

import com.example.android.bean.AddCar;
import com.example.android.bean.BaseLoginToken;
import com.example.android.bean.BaseModelTable;
import com.example.android.bean.BaseUserModel;
import com.example.android.bean.Login;
import com.example.android.bean.RegisterUser;
import com.example.android.utils.BaseModel;

import okhttp3.MultipartBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.DELETE;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Part;
import retrofit2.http.Path;

public interface BackApi {
    @POST("/login")
    Call<BaseLoginToken> loginUser(@Body Login login);

    @GET("/getInfo")
    LiveData<BaseUserModel> getUserInfo();

    @POST("/register")
    Call<BaseModel<String>> registerUser(@Body RegisterUser registerUser);

    @POST("/car")
    Call<BaseModel<String>> addCarInfo(@Body AddCar car);

    @GET("/car/{id}")
    Call<BaseModel<AddCar>> carInfo(@Path("id") Long carId);

    @GET("/car/list")
    LiveData<BaseModelTable<AddCar>> carList();

    @DELETE("/car/{ids}")
    Call<BaseModel<Object>> deleteCar(@Path("ids") Long ids);

    @Multipart
    @POST("/common/upload")
    Call<BaseModel<String>> uploadImage(@Part MultipartBody.Part file);
//
//    @PUT("system/user")
//    Call<BaseModel<String>> putUser(@Body UserSave user);

    @Multipart
    @POST("/system/user/profile/avatar")
    Call<BaseModel<Object>> uploadAvatarBaseModelCall(@Part MultipartBody.Part avatarfile);

}
